{extend name="base"/}
{block name="title"}
   {:lang('编辑订单')}
{/block}
{block name="css"}
<link rel="stylesheet" href="__MOBILE__/css/zhangmall.css">
<style>
    body{background: #f5f5f5;}
    .bu_messages{margin-top: 1rem;background-color: #fff;}
    .goods{background: #fff;margin-bottom: 0.2rem;margin-top:0.2rem;}
    .paywayright{display:block;width:95%;height: .8rem;background:#ff900d;margin:0 auto;margin-top: 2.5rem;text-align:center;border-radius: .1rem;}
    .paywayright .rightbtn{display:block;font-size: .36rem;color:#fff;padding-top: .25rem;letter-spacing: .02rem;}
   
</style>
{/block}
{block name="content"}
<!-- 头部 -->
<div class="fxm_header">
    <div class="fxm_left">
            <a href="javascript:history.go(-1)"><img src="__MOBILE__/images/true.png" alt=""></a>
    </div>
    <div class="fxm_center">{:lang('编辑运单号')}</div>
</div>

<div class="bu_messages">
        <span class="ownmess">{:lang('收货人')}:{:lang($order[0]['username'])}</span>
        <span class="bu_tel">{$order[0]['mobile']}</span>
        <div class="clr"></div>
        <span class="bu_ordericon"></span>
        <div class="bu_orderaddress">
            <a href="javascript:void(0)">
                    {:lang('收货地址：'.$order[0]['address'])}
            </a>
        </div>
        <span class="agasintime">{:lang('创建时间')}</span>
        <span class="bu_time">{$order[0]['create_time']}</span>
</div>

<!--订单列表start-->
{foreach $order as $key=>$value}
<div class="goods">
    <p class="shop_name"><a href="javascript:void(0)">{$shop_info.name}</a></p>
    <ul>
        <div class="con_in">
            <a href="{:url('/shop/Goods/goods_detail',['good_id'=>$value.goods_id])}">
                <img src="{$value.goodsimg}" alt="">
                <p class="desc">{:lang($value.gname)}</p>
                <p class="model">{:lang('合计：&yen'.$value.tprice)}</p>
                <div class="con_right">
                    <p class="mon"><span>￥</span>{$value.dprice}</p>
                    <p class="onum"><span>×</span>{$value.num}</p>
                </div>
            </a>
        </div>
    </ul>
</div>
{/foreach}
<!--订单列表end--> 

<div class="way">
    <div class="dist">{:lang('配送方式')}
        <p class="dist_ch">{:lang('快递 普通')}</p>
    </div>
    <div class="dist">{:lang('运费')}
            <p class="dist_ch">{$postage}</p>
    </div>
    <div class="leave" style="margin-top:5%;">

        {:lang('运单号:')} <input type="text" name="ship_num" placeholder="商家输入该订单的运单号"  value="{$order[0]['ship_num']}"/>

    </div>

</div>

<a class="paywayright">
    <span class="rightbtn">{:lang('保存编辑')}</span>
</a>   

<div class="popup">
        <div class="pop_con">
            <div class="pop_con_tit">{:lang('快递 普通')}</div>
            <div class="pop_con_con">
                <p style="color: #666;">{:lang('详情咨询商家')}</p>
            </div>
            <div class="pop_last">{:lang('确定')}</div>
        </div>
</div>

{/block}
{block name="js"}
<script>
    $(".dist_ch").eq(0).click(function(){
        $(".pop_con_tit").html("{:lang('快递 普通')}");
        $(".pop_con_con p").html("{:lang('详情咨询商家')}");
        $(".popup").show();
    });
    $(".dist_ch").eq(1).click(function(){
        $(".pop_con_tit").html("{:lang('运费')}");
        $(".pop_con_con p").html("{:lang('暂无运费险')}");
        $(".popup").show();
    });

    $(".pop_last").click(function(){
        $(".popup").hide();
    });

    $(".rightbtn").click(function(){
        var ship_num = $('input[name=ship_num]').val();

        if(!ship_num)
            msg_alert('请输入运单号');
        else{
            $.post("{:url('Merchant_order/ship',['order_number'=>$order[0]['order_number']])}", {ship_num:ship_num}, function(res){
                if(res.status == 1)
                {
                    msg_alert('操作成功',res.url);

                }
                else{
                    msg_alert(res.msg);
                }
            })
        }
    });

</script>
{/block}
